package com.project.config.Alibaba;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayTradeAppPayModel;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import com.project.util.alibaba.AlibabaMainUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: AlibabaConfig <br/>
 * Description: <br/>
 * date: 2019/1/7 17:26<br/>
 *
 * @author lenovo<br />
 * @since JDK 1.8
 */
@Configuration
public class AlibabaConfig {

    @Bean
    public AlipayClient setAlipayClient(){
        return  new DefaultAlipayClient(AlibabaMainUtil.URL,AlibabaMainUtil.AppID,AlibabaMainUtil.RSA_PRIVATE_KEY,AlibabaMainUtil.FORMAT,AlibabaMainUtil.CHARSET,AlibabaMainUtil.ALIPAY_PUBLIC_KEY,AlibabaMainUtil.SIGNTYPE);
    }

    @Bean
    public AlipayTradeWapPayRequest getAlipayTradeWapPayRequest(){
        return new AlipayTradeWapPayRequest();
    }

    @Bean
    public AlipayTradeAppPayModel getAlipayTradeAppPayModel(){
        return  new AlipayTradeAppPayModel();
    }

}
